<template>
  <div>
    <p>count: {{count}}</p>
    <button @click="count++">+1</button>
  </div>
</template>

<script>
import { ref, watch } from 'vue';

export default {
  setup () {
    const count = ref(1)

    // !不要 watch(count.value) 这种写法
    watch(count, (newValue, oldValue) => {
      console.log(newValue, oldValue);
    })

    return {count}
  }
}
</script>

<style lang="scss" scoped>

</style>